//
//  LzwBniTopCollectCell.m
//  CoJellyCartoon
//
//  Created by 刘志武 on 16/4/1.
//  Copyright © 2016年 CJG. All rights reserved.
//

#import "LzwBniTopCollectCell.h"
#import "Masonry.h"

#import <UIImageView+WebCache.h>

@interface LzwBniTopCollectCell ()

@property (nonatomic, strong) UIImageView *myImageView;
@property (nonatomic, strong) UILabel *lableTitle;
@property (nonatomic, strong) UILabel *lableContent;
@property (nonatomic, strong) UILabel *lableTime;

@end



@implementation LzwBniTopCollectCell

-(instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    
    if (self) {
        [self creatC];
    }
    
    return self;
}

- (void)creatC{
    
    self.myImageView = [[UIImageView alloc]init];
    self.myImageView.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.myImageView];
    
    self.lableTitle = [[UILabel alloc]init];
    self.lableTitle.textColor = [UIColor lightGrayColor];
    self.lableTitle.font = [UIFont systemFontOfSize:15];
    self.lableTitle.textAlignment = 1;
    self.lableTitle.numberOfLines = 0;
    [self.contentView addSubview:self.lableTitle];
    
//    self.lableContent = [[UILabel alloc]init];
//    self.lableContent.backgroundColor = [UIColor yellowColor];
//    self.lableContent.textColor = [UIColor cyanColor];
//    [self.contentView addSubview:self.lableContent];
//    
//    
//    self.lableTime = [[UILabel alloc]init];
//    self.lableTime.backgroundColor = [UIColor redColor];
//    self.lableTime.textAlignment = 1;
//    self.lableTime.textColor = [UIColor lightGrayColor];
//    [self.contentView addSubview:self.lableTime];
//    
//    
    
    
    [self.myImageView mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.contentView).offset(0);
        make.right.equalTo(self.contentView).offset(0);
        make.width.equalTo(self.contentView);
        make.height.equalTo(@100);
        
        
    }];
    
    
    [self.lableTitle mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.myImageView.mas_bottom).offset(5);
        make.left.equalTo(self.contentView).offset(10);
        make.width.equalTo(@150);
        make.height.equalTo(@50);
        
        
    }];
    
//    [self.lableContent mas_makeConstraints:^(MASConstraintMaker *make) {
//       
//        make.bottom.equalTo(self.contentView.mas_bottom).offset(-5);
//        make.left.equalTo(self.contentView).offset(10);
//        make.width.equalTo(self.lableTitle.mas_width).offset(-70);
//        make.height.equalTo(self.lableTitle.mas_height);
//        
//    }];
//    
//    [self.lableTime mas_makeConstraints:^(MASConstraintMaker *make) {
//       
//        make.bottom.equalTo(self.contentView.mas_bottom).offset(-5);
//        make.left.equalTo(self.lableContent.mas_right).offset(10);
//        make.height.equalTo(self.lableContent.mas_height);
//        make.width.equalTo(@70);
//        
//    }];
    

    
}



-(void)setModleLates:(LzwLatesModel *)modleLates{
    
    _modleLates = modleLates;
    
    self.lableTitle.text = _modleLates.title;
    
    
    NSURL *url = [NSURL URLWithString:_modleLates.cover];
    
    [self.myImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"zhanweiye"]];
    
}


@end
